//
//  ViewController.swift
//  MVP框架设计_Swift
//
//  Created by globalives2 on 2017/2/27.
//  Copyright © 2017年 globalives2. All rights reserved.
//

import UIKit

class ViewController: UIViewController ,LoginView{
    
    private var presenter:LoginPresenter?
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.presenter = LoginPresenter()
        //绑定
        self.presenter?.attachView(view: self)
        // 发送请求
        self.presenter?.login(name: "Login", password: "123456")
        
    }
    func onLoginResult(result: String) {
        print("服务器返回结果：\(result)")
        self.presenter?.detachView()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

